[−][src]Crate jemalloc_sys
Rust bindings to the jemalloc
C library.
jemalloc
is a general purpose memory allocation, its documentation
can be found here:
- API documentation
- Wiki (design documents, presentations, profiling, debugging, tuning, ...)
jemalloc
exposes both a standard and a non-standard API.
Standard API
The standard API includes: the malloc
, calloc
, realloc
, and
free
, which conform to to ISO/IEC 9899:1990 (“ISO C90”),
posix_memalign
which conforms to conforms to POSIX.1-2016, and
aligned_alloc
.
Note that these standard leave some details as implementation defined.
This docs document this behavior for jemalloc
, but keep in mind that other
standard-conforming implementations of these functions in other allocators
might behave slightly different.
Non-Standard API
The non-standard API includes: mallocx
, rallocx
, xallocx
,
sallocx
, dallocx
, sdallocx
, and nallocx
. These functions all
have a flags
argument that can be used to specify options. Use bitwise or
|
to specify one or more of the following: MALLOCX_LG_ALIGN
,
MALLOCX_ALIGN
, MALLOCX_ZERO
, MALLOCX_TCACHE
,
MALLOCX_TCACHE_NONE
, and MALLOCX_ARENA
.
Environment variables
The MALLOC_CONF
environment variable affects the execution of the allocation functions.
For the documentation of the MALLCTL
namespace visit the jemalloc
documenation.
Structs
extent_hooks_s | Extent lifetime management functions. |
Constants
MALLOCX_ZERO | Initialize newly allocated memory to contain zero bytes. |
Statics
malloc_conf | Compile-time string of configuration options. |
malloc_message | Allows overriding the function which emits the text strings forming the
errors and warnings if for some reason the |
Functions
MALLOCX_ALIGN | Align the memory allocation to start at an address that is a multiple of |
MALLOCX_ARENA | Use the arena specified by the index |
MALLOCX_LG_ALIGN | Align the memory allocation to start at an address that is a
multiple of |
MALLOCX_TCACHE | Use the thread-specific cache (tcache) specified by the identifier |
MALLOCX_TCACHE_NONE | Do not use a thread-specific cache (tcache). |
aligned_alloc⚠ | Allocates |
calloc⚠ | Allocates zero-initialized space for an array of |
dallocx⚠ | Deallocates previously-allocated memory region referenced by |
free⚠ | Deallocates previously-allocated memory region referenced by |
mallctl⚠ | General interface for introspecting the memory allocator, as well as setting modifiable parameters and triggering actions. |
mallctlbymib⚠ | Like |
mallctlnametomib⚠ | Translates a name to a “Management Information Base” (MIB) that can be
passed repeatedly to |
malloc⚠ | Allocates |
malloc_stats_print⚠ | Writes summary statistics via the |
malloc_usable_size⚠ | Returns the real size of the previously-allocated memory region
referenced by |
mallocx⚠ | Allocates at least |
nallocx⚠ | Returns the real size of the allocation that would result from a
|
posix_memalign⚠ | Allocates |
rallocx⚠ | Resizes the previously-allocated memory region referenced by |
realloc⚠ | Resizes the previously-allocated memory region referenced by |
sallocx⚠ | Returns the real size of the previously-allocated memory region
referenced by |
sdallocx⚠ | Deallocates previously-allocated memory region referenced by |
xallocx⚠ | Resizes the previously-allocated memory region referenced by |
Type Definitions
extent_alloc_t | Extent allocation function. |
extent_commit_t | Extent commit function. |
extent_dalloc_t | Extent deallocation function. |
extent_decommit_t | Extent decommit function. |
extent_destroy_t | Extent destruction function. |
extent_hooks_t | Extent lifetime management functions. |
extent_merge_t | Extent merge function. |
extent_purge_t | Extent purge function. |
extent_split_t | Extent split function. |